#!/bin/sh

# 确保将要提交的所有 JavaScript 代码通过 standard 规范的检查

RESULT1=0

checkNewAppStyle () {
  git diff --name-only --cached --relative | grep 'src/.*\.js\?$' | xargs ./node_modules/eslint/bin/eslint.js -c ./.eslintrc.json --parser babel-eslint
  RESULT1=$?
}
checkNewAppStyle

if [[ (($RESULT1 != 0)) ]]; then exit 1; fi
